package com.anyou.mall.order.orderGoods.service.impl;

import java.util.List;
import com.anyou.common.utils.DateUtils;
import com.anyou.mall.goo.specs.domain.SpeSpecsValue;
import com.anyou.mall.goo.specs.mapper.SpeSpecsValueMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.anyou.mall.order.orderGoods.mapper.OrdOrderGoodsMapper;
import com.anyou.mall.order.orderGoods.domain.OrdOrderGoods;
import com.anyou.mall.order.orderGoods.service.IOrdOrderGoodsService;

/**
 * 订单商品Service业务层处理
 *
 * @author xq
 * @date 2022-03-28
 */
@Service
public class OrdOrderGoodsServiceImpl extends ServiceImpl<OrdOrderGoodsMapper, OrdOrderGoods> implements IOrdOrderGoodsService
{
    @Autowired
    private OrdOrderGoodsMapper ordOrderGoodsMapper;

    /**
     * 查询订单商品
     *
     * @param orderGoodsId 订单商品主键
     * @return 订单商品
     */
    @Override
    public OrdOrderGoods selectOrdOrderGoodsByOrderGoodsId(Long orderGoodsId)
    {
        return ordOrderGoodsMapper.selectOrdOrderGoodsByOrderGoodsId(orderGoodsId);
    }

    /**
     * 查询订单商品列表
     *
     * @param ordOrderGoods 订单商品
     * @return 订单商品
     */
    @Override
    public List<OrdOrderGoods> selectOrdOrderGoodsList(OrdOrderGoods ordOrderGoods)
    {
        return ordOrderGoodsMapper.selectOrdOrderGoodsList(ordOrderGoods);
    }

    /**
     * 新增订单商品
     *
     * @param ordOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int insertOrdOrderGoods(OrdOrderGoods ordOrderGoods)
    {
      /*  ordOrderGoods.setCreateTime(DateUtils.getNowDate());*/
        return ordOrderGoodsMapper.insertOrdOrderGoods(ordOrderGoods);
    }

    /**
     * 修改订单商品
     *
     * @param ordOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int updateOrdOrderGoods(OrdOrderGoods ordOrderGoods)
    {
        return ordOrderGoodsMapper.updateOrdOrderGoods(ordOrderGoods);
    }

    /**
     * 批量删除订单商品
     *
     * @param orderGoodsIds 需要删除的订单商品主键
     * @return 结果
     */
    @Override
    public int deleteOrdOrderGoodsByOrderGoodsIds(Long[] orderGoodsIds)
    {
        return ordOrderGoodsMapper.deleteOrdOrderGoodsByOrderGoodsIds(orderGoodsIds);
    }

    /**
     * 删除订单商品信息
     *
     * @param orderGoodsId 订单商品主键
     * @return 结果
     */
    @Override
    public int deleteOrdOrderGoodsByOrderGoodsId(String orderGoodsId)
    {
        return ordOrderGoodsMapper.deleteOrdOrderGoodsByOrderGoodsId(orderGoodsId);
    }
}
